﻿using EP.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace errorpig_web_server
{
    /// <summary>
    /// 
    /// </summary>
    public class EPEngine : IEngine
    {
        private IServiceProvider _serviceProvider;


        public EPEngine(IServiceProvider serviceProvider)
        {
            this._serviceProvider = serviceProvider;
        }

        /// <summary>
        /// 构建实例
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <returns></returns>
        public T Resolve<T>() where T : class
        {
            // TODO：更改
            return _serviceProvider.GetService(typeof(T)) as T;
        }
    }
}
